package com.github.od.mapper;

import java.util.List;

import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import com.github.od.entity.Client;

import tk.mybatis.mapper.common.Mapper;

public interface ClientMapper extends Mapper<Client> {

	/**
	 * 获取合法的客户端列表
	 * @param clientId
	 * @return
	 */
	@Select("select c.code\n" + 
			"  	from gate_client c\n" + 
			"  	inner join gate_client_service gcs\n" + 
			"  	on gcs.client_id = c.id\n" + 
			"  	where gcs.service_id = #{serviceId}")
	@ResultType(String.class)
	List<String> selectAllowedClient(String serviceId);
}